package com.gitee.feizns.quickstart.web.spring.boot.autoconfigure.ex;

import com.gitee.feizns.quickstart.web.ex.GlobalRestfulExceptionAdvice;
import lombok.Data;
import org.springframework.boot.context.properties.ConfigurationProperties;
import org.springframework.http.HttpStatus;

/**
 * 全局异常解析器配置，
 * @see GlobalRestfulExceptionAdvice
 * @author feizns
 * @since 2019/6/13
 */
@Data
@ConfigurationProperties("quickstart.web.ex")
public class GlobalExceptionProperties {

    /**
     * 是否是调试模式：调试模式 将打印 Throwable.printStackTrace().
     */
    private boolean debug = true;

    /**
     * 数据校验失败的后的响应http状态码
     */
    private HttpStatus validationFailHttpStatus = HttpStatus.BAD_REQUEST;

    /**
     * 资源不存在校验失败的后的响应http状态码
     */
    private HttpStatus notFoundHttpExceptionHttpStatus = HttpStatus.NOT_FOUND;

}
